//
//  MsgItem.h
//  ChangChat
//
//  Created by Cocoa on 2019/8/28.
//  Copyright © 2019 yibai. All rights reserved.
//

#import "YBBaseItem.h"

///  消息类型 0：文本、 1：图片 2：语音 3：视频 4：文件 5：时间 6：名片
typedef NS_ENUM(NSUInteger, MsgType) {
    MsgType_Text = 0,
    MsgType_Photo = 1,
    MsgType_Voice = 2,
    MsgType_Video = 3,
    MsgType_File = 4,
    MsgType_Time = 5,
    MsgType_Card = 6,
    MsgType_Tip = 7,
    MsgType_Friend_apply = 8,
    MsgType_Friend_agree = 9,
    MsgType_Friend_delete = 10,
    MsgType_Friend_rejected = 11,
    MsgType_Msg_recall = 21,
    MsgType_Msg_read = 22,
    MsgType_User_update = 31,
    MsgType_User_nickname_update = 32,
    MsgType_Group_update = 40
};

typedef NS_ENUM(NSUInteger, SendStatus) {
    SendStatus_receiving = -1,
    SendStatus_waitSend = 0,
    SendStatus_sending,
    SendStatus_failed,
    SendStatus_success,
};


@interface MsgItem : YBBaseItem
///  消息id
@property (nonatomic, assign) NSInteger message_id;
///  远程消息id
@property (nonatomic, assign) NSInteger remote_msg_id;
///  发送者
@property (nonatomic, copy) NSString *send_user_id;
///  接受者
//@property (nonatomic, copy) NSString *to_user_id;
///  群组id
@property (nonatomic, copy) NSString *group_id;
///  消息类型
@property (nonatomic, assign) MsgType type;
///  创建时间
@property (nonatomic, copy) NSString *createtime;
///  是否已确认收到 0:未确认收到， 1：已确认收到
@property (nonatomic, assign) BOOL is_received;
///  是否已读
@property (nonatomic, assign) BOOL is_read;
///  发送接收状态
@property (nonatomic, assign) SendStatus sendStatus;
///  消息体
@property (nonatomic, copy) NSString *content;
///  缩略图
@property (nonatomic, copy) NSString *s_image;
///  语音消息时间
@property (nonatomic, assign) NSInteger second;
///  文件名
@property (nonatomic, copy) NSString *file_name;
///  文件大小
@property (nonatomic, copy) NSString *file_size;

///  本地文件路径
@property (nonatomic, copy) NSString *filePath;

- (NSString *)allFilePath;
- (NSString *)lastMsgTip;
@end

